import request from '@/utils/request'
// 获取工资列表
export function getSalarys(data) {
  return request({
    url: '/salarys/list',
    method: 'post',
    data
  })
}

// 获取调薪列表
export function getChangeSalarys(userId) {
  return request({
    url: `/salarys/modify/${userId}?userId=` + userId,
    method: 'get'
  })
}

// 调整薪资
export function changeSalarys(userId, data) {
  return request({
    url: `/salarys/modify/${userId}`,
    method: 'post',
    data
  })
}

// 用户定薪
export function okSalarys(data) {
  return request({
    url: `/salarys/init/${data.userId}`,
    method: 'post',
    data
  })
}

// 获取企业计薪及津贴设置
export function getSalaryssetting() {
  return request({
    url: `/salarys/settings`
  })
}

// 获取企业是否设置当月工资
export function getsettingMonth() {
  return request({
    url: `/salarys/company-settings`
  })
}

// 根据用户id查询用户的社保数据
export function socialSecuritys(id) {
  return request({
    url: `/social_securitys/${id}`
  })
}
export function getArchivingList(params) {
  return request({
    url: `/salarys/reports/${params.year}`,
    params
  })
}
export function getArchivingCont(params) {
  return request({
    url: `/salarys/reports/${params.yearMonth}`,
    params
  })
}
export function newReport(data) {
  return request({
    url: `/salarys/reports/${data.yearMonth}/newReport`,
    method: 'put',
    data
  })
}
// 根据年月查询企业用户薪资列表
export function reports(params) {
  return request({
    url: `/salarys/reports/${params}?yearMonth=${params}`
    // /salarys/reports/{yearMonth}

  })
}

// 保存企业计薪及津贴设置
export const saveSalalysSetting = (data) => {
  return request({
    url: '/salarys/settings',
    method: 'post',
    data
  })
}

